
from selenium import webdriver
from time import sleep
# 导入动作链对应的类
from selenium.webdriver import ActionChains

# 实例化浏览器对象
bro = webdriver.Chrome(executable_path='./chromedriver')

bro.get('https://qzone.qq.com/')
# 定位的标签是存在于iframe标签中的必须通过switch_to.frame()
bro.switch_to.frame('login_frame')

# 标签定位：find_element_by_id()方法
a_tag = bro.find_element_by_id('switcher_plogin')
# 点击
a_tag.click()

username_tag = bro.find_element_by_id('u')
password_tag = bro.find_element_by_id('p')

username_tag.send_keys('1477520706')
sleep(0.5)
password_tag.send_keys('mf84912856.')
sleep(0.5)
btn = bro.find_element_by_id('login_button')
btn.click()

# sleep(3)

# bro.quit()


















